/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2024-07-28 10:47:10
 * @LastEditors: zss
 * @LastEditTime: 2025-02-10 10:01:58
 */
import { N_cStph } from '@/types';
import Vue from 'vue';
/* import {} from '@/types' */
/*
 * props
 */
export namespace N_cPLDetails {
  // eslint-disable-next-line no-shadow
  export enum V_ecDatatype {
    Float32 = 0,
    Float64,
    Int8,
    Int16,
    Int32,
    Int64,
    UInt8,
    UInt16,
    UInt32,
    UInt64,
    DateTime,
    Date,
    Time,
    Bool,
    String,
    Bit
  }

  // eslint-disable-next-line no-shadow
  export enum V_ecBoxType {
    NOTSET = 0,
    MITSUBISHI_PLC_Q,
    SIEMENS_PLC_S7_1500,
    SIEMENS_PLC_S7_200_SMART
  }
  // eslint-disable-next-line no-shadow
  export enum V_reqStatus {
    NOTSTART = 0,
    RUNNING,
    FINISHED
  }
  export interface I_readResp {
    success: boolean;
    msg: string;
    data: {
      [key: string]: {
        dataType?: V_ecDatatype;
        controllerType?: V_ecBoxType;
        v: any;
        err?: string;
      };
    };
  }

  export interface I_schedulingResp {
    code: number;
    message: string;
    data: any;
  }
  export interface I_writeResp {
    success: boolean;
    msg: string;
    data: null;
  }

  export type I_standardResp = I_writeResp;
  export interface I_writeCodeRes {
    ecDetCode: string;
    value: string;
  }
  export interface I_writeRes {
    writeList: I_writeCodeRes[];
  }
  export interface I_ecDetInfo {
    ecDetCode: string;
    value: string;
    registerAddress: string;
    tankName: string;
    tankNum: string;
    conversionRate: number;
  }
  export interface I_receiveParams {
    currentRowID: string;
    ecDetCodes: Array<I_ecDetInfo>;
  }
  export interface I_processInfo {
    processID: string;
    pslotInfo: {
      slotID: string;
      x: number;
      y: number;
    };
    processParams?: {
      workTime?: number;
      tempRange?: number;
      tempFluc?: number;
    };
  }
  export interface I_hangGroupInfo {
    hangGroupNum: string;
    processInfo: Array<I_processInfo>;
  }
  export interface I_schedulRegis {
    cranes: Array<any>;
    hangGroups: Array<I_hangGroupInfo>;
  }

  export interface I_handleBtn {
    type:
      | 'default'
      | 'primary'
      | 'dashed'
      | 'text'
      | 'info'
      | 'success'
      | 'warning'
      | 'error';
    title: string;
    key: string;
    ghost: boolean;
    size: 'large' | 'small' | 'default';
    disabled: boolean;
    icon: string;
  }

  export interface T_msgScadaModbusSubscription {
    appNum: number; // 应用编号

    dataType: string; // 数据类型

    value: any;
  }

  export interface I_cacheInfo {
    // 缓存位挂组id
    hangGroupId: {
      code: string;
      value: number;
    };
    // 缓存位加工顺序
    cacheOrder: {
      code: string;
      value: number;
    };
    // 缓存位状态
    hangGroupStatus: {
      code: string;
      value: boolean;
    };
    // 温度是否满足
    tempIsSatisfied: {
      code: string;
      value: boolean;
    };
  }

  export interface hgSpecProcessInfo {
    tankName: string;
    setTemp: number;
    fluTemp: number;
  }

  export interface hgSpecProcess {
    hgID: number;
    processPara: hgSpecProcessInfo[];
  }

  export interface businessNumInfo {
    businessNum: number;
    fName: string;
    conversionRate: number;
    processTankId: string;
    processTank: string;
    paraId: string;
  }

  export interface plDetailsRows {
    id: string;
    begin_time: string;
    end_time: string;
    f_name: string;
    f_status: 0 | 1 | 2 | 3 | 4 | 5 | 6;
    hang_group_num: string;
    is_automated_produc: 0 | 1;
    part_qty: number;
    physical_num: number;
    process_flow_num: string;
    process_main_tank: 1 | 2 | 3;
  }

  export interface cPLDetails extends Vue {
    funName: string;
    topTableData: any[];
    tanks: N_cStph.TankConfig[];
    cranes: N_cStph.craneControlConfig[];
    currentOpenLineInfo: {
      id: string;
      title: string;
    };
    formData: {
      id: string;
      physical_produc_line: string;
      produc_line_name: string;
      f_status: number;
      process_flow_num: string;
      produc_line_num: string;
      'm2o|process_flow_num|process_mgmt|title': string;
      'm2o|physical_produc_line|physical_produc_line_mgmt|f_name': string;
    };
    sendLogOut: (logData: Array<object | string> | object | string) => void;
  }
}
